import Vue from 'vue'
import router from '@/router/index.js'
import Vuex from 'vuex'
import Cookies from 'js-cookie'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    auditRemarks: '',
    payOrderNo: '',
    merchantDet: {},
    orderNo: '',
    InReview: [],
    router: []
  },
  mutations: {
    showRemarks (state, data) {
      state.auditRemarks = data
    },
    handlePayNo (state, data) {
      state.payOrderNo = data
    },
    handlePMerDet (state, data) {
      state.merchantDet = data
    },
    handleOrderNo (state, data) {
      state.orderNo = data
    },
    handleReview (state, data) {
      state.InReview.push(data)
    },
    handleReviewaaa (state, idx) {
      state.InReview.splice(idx, 1)
    },
    getRouteMenu (state, list) {
      state.router.push(...list)
      router.addRoutes(list)
    }
  },
  actions: {
  },
  modules: {
  },
  getters: {
  }
})

export default store
